<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
		<title>博客表-新增</title>
		<script type="text/javascript" src="../../commonFragment/header.js"></script>
		<script type="text/javascript" src="../../commonFragment/nojs.header.js"></script>
		<link rel="stylesheet" type="text/css" href="../../assets/lib/editor.md-master/css/editormd.min.css" />
		<script src="../../assets/lib/editor.md-master/editormd.js" type="text/javascript" charset="utf-8"></script>
		<script>
			$(function(){
				//把标签的name写到隐藏的标签
				$("#tagIds").on("select2:select select2:close",function(){
					var names = "";
					$("option:selected", $(this)).each(function(){
						names = names + $(this).text() + ",";
					});
					if(names.length > 1){
						names = names.substring(0, names.length -1);
					}
					$("#tagNames").val(names);
				});

			});
			
		</script>
	</head>
	<body>
		<div class="container-fluid p-t-15">
			<div class="row">
				<div class="col-lg-12">
					<div class="card">
						<div class="card-body">
							<form class="form-horizontal validate" role="form vue-form" method="post" action="/blog/article/save"
							 data-form-url="/blog/article/detail">
								<div class="form-group hide">
									<label for="parentId" class="col-md-1 col-sm-1 control-label">隐藏的*</label>
									<div class="col-sm-9  col-md-9  ">
										<input type="text" id="id" name="id" :value="id" />
									</div>
									<div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group">
									<label for="icon" class="col-md-1 col-sm-1 control-label">图标</label>
									<div class="col-sm-9  col-md-9  ">
										<input type="hidden" name="icon" :value="icon" data-rule-required="false" />
										<!-- data-rule-accept="image/*" -->
										<input type="file" class="fileupload" name="icon" data-preview="true" data-display-id="icon" />
									</div>
									<div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group">
									<label for="title" class="col-md-1 col-sm-1 control-label">标题*</label>
									<div class="col-sm-9  col-md-9  ">
										<input type="text" class="form-control" id="title" name="title" :value="title" data-rule-required="true"
										 placeholder="请输入标题" autocomplete="off" />
									</div>
									<div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group">
									<label for="summary" class="col-md-1 col-sm-1 control-label">简介*</label>
									<div class="col-sm-9  col-md-9  ">
										<textarea rows="3" class="form-control" id="summary" name="summary" :value="summary" data-rule-required="true"
										 placeholder="请输入简介" autocomplete="off"></textarea>
										
									</div>
									<div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group">
									<label for="categoryId" class="col-md-1 col-sm-1 control-label">分类*</label>
									<div class="col-sm-9  col-md-9  ">
										<select class="form-control select2" id="categoryId" name="categoryId" :data-value="categoryId" :value="categoryId"
										 data-rule-required="true" data-url="/blog/category/all">
											<option value="">--请选择--</option>
										</select>

									</div>
									<div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group">
									<label for="author" class="col-md-1 col-sm-1 control-label">作者*</label>
									<div class="col-sm-9  col-md-9  ">
										<input type="text" class="form-control" id="author" name="author" :value="author" data-rule-required="true"
										 placeholder="请输入作者" autocomplete="off" />
									</div>
									<div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group">
									<label for="originated" class="col-md-1 col-sm-1 control-label">原创</label>
									<div class="col-sm-9  col-md-9  ">
										<label class="radio-inline">
											<input type="radio" value="1" name="originated" data-rule-required="true" v-model="originated">原创
										</label>
										<label class="radio-inline">
											<input type="radio" value="0" name="originated" data-rule-required="true" v-model="originated">非原创
										</label>
									</div>
									<div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group">
									<label for="source" class="col-md-1 col-sm-1 control-label">来源</label>
									<div class="col-sm-9  col-md-9  ">
										<input type="text" class="form-control" id="source" name="source" :value="source" data-rule-required="false"
										 placeholder="非原创时请输入来源" autocomplete="off" />
									</div>
									<div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group">
									<label for="tagIds" class="col-md-1 col-sm-1 control-label">标签*</label>
									<div class="col-sm-9  col-md-9  ">
										<select class="form-control select2" id="tagIds" name="tagIds" :data-value="tagIds" :value="tagIds" 
										 multiple="multiple" data-placeholder="标签可多选"
										 data-rule-required="true" data-url="/blog/tag/all">
										</select>
										<input class="hidden" id="tagNames" name="tagNames"  :value="tagNames"/>
									</div>
									<div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
								</div>

								<div class="form-group">
									<label for="topicId" class="col-md-1 col-sm-1 control-label">专题</label>
									<div class="col-sm-9  col-md-9  ">
										<select class="form-control select2" id="topicId" name="topicId" :data-value="topicId" :value="topicId"
										 data-rule-required="false" data-url="/blog/topic/all">
											<option value="">--请选择--</option>
										</select>
									</div>
									<div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group">
									<label for="authority" class="col-md-1 col-sm-1 control-label">权限*</label>
									<div class="col-sm-9  col-md-9  ">
										<select class="form-control input-sm" id="authority" name="authority" :data-value="authority" :value="authority"
										 data-rule-required="true">
											<option value="0">公开</option>
											<option value="1">好友</option>
											<option value="1">自己</option>
										</select>
									</div>
									<div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group">
									<label for="enable" class="col-md-1 col-sm-1 control-label">发布*</label>
									<div class="col-sm-9  col-md-9  ">
										<select class="form-control input-sm" id="enable" name="enable" :data-value="enable" :value="enable">
											<option value="true">是</option>
											<option value="false">否</option>
										</select>
									</div>
									<div class="col-md-2 col-sm-2  help-inline form-control-static"></div>
								</div>
								<div class="form-group">
									<label for="content" class="col-md-1 col-sm-1 control-label">内容*</label>
									<div class="clearfix" style="margin: 10px;"></div>
									<div class="editormd" data-height="650" data-width="95%">
										<textarea name="content"   class="form-control" style="display:none;" v-model="content"></textarea>
									</div>
									<!-- <div class="col-sm-9  col-md-9  ">
										<input type="text" class="form-control" id="content" name="content" :value="content" data-rule-required="true"
										 placeholder="请输入内容" autocomplete="off" />
									</div>
									<div class="col-md-2 col-sm-2  help-inline form-control-static"></div> -->
								</div>

								<div class="form-group clearfix">
									<div class="col-sm-offset-3 col-sm-9">
										<button type="button" class="btn btn-primary action-ajax-form">
											<i class="glyphicon glyphicon-ok"></i> 提交
										</button>
										<button type="button" class="btn btn-info action-close-tab">
											<i class="glyphicon glyphicon-repeat"></i> 返回
										</button>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>
